//
//  HNSH_XFBManageTopView.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2024/2/22.
//

#import "HNSH_XFBManageTopView.h"

@interface HNSH_XFBManageTopView ()

/* bgImgV */
@property (nonatomic, strong) UIImageView *bgImgV;

/* leftBgimgV */
@property (nonatomic, strong) UIImageView *leftBgimgV;
/* leftTopLabel */
@property (nonatomic, strong) UILabel *leftTopLabel;
/* leftBottomLabel */
@property (nonatomic, strong) UILabel *leftBottomLabel;

/* rightBgimgV */
@property (nonatomic, strong) UIImageView *rightBgimgV;
/* rightTopLabel */
@property (nonatomic, strong) UILabel *rightTopLabel;
/* rightBottomLabel */
@property (nonatomic, strong) UILabel *rightBottomLabel;

@end

@implementation HNSH_XFBManageTopView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self configUI];
    }
    return self;
}

- (void)configUI {
    [self addSubview:self.bgImgV];
    [self.bgImgV addSubview:self.leftBgimgV];
    [self.leftBgimgV addSubview:self.leftTopLabel];
    [self.leftBgimgV addSubview:self.leftBottomLabel];
    [self.bgImgV addSubview:self.rightBgimgV];
    [self.rightBgimgV addSubview:self.rightTopLabel];
    [self.rightBgimgV addSubview:self.rightBottomLabel];
}

#pragma mark lazy
- (UIImageView *)bgImgV {
    if (!_bgImgV) {
        _bgImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kStatusBarHeight+155)];
        _bgImgV.image = [UIImage imageNamed:@"xfb_top_bg"];
    }
    return _bgImgV;
}

- (UIImageView *)leftBgimgV {
    if (!_leftBgimgV) {
        _leftBgimgV = [[UIImageView alloc]initWithFrame:CGRectMake(12, kStatusBarHeight+20, (kScreenWidth-40)/2, 80)];
        _leftBgimgV.image = [UIImage imageNamed:@"xfb_top_grhyd_bg"];
    }
    return _leftBgimgV;
}

- (UILabel *)leftTopLabel {
    if (!_leftTopLabel) {
        _leftTopLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 14, self.leftBgimgV.width-36, 30)];
        _leftTopLabel.textColor = [UIColor appWhiteLabelColor];
        _leftTopLabel.font = [UIFont boldSystemFontOfSize:22];
    }
    return _leftTopLabel;
}

- (UILabel *)leftBottomLabel {
    if (!_leftBottomLabel) {
        _leftBottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 46, self.leftBgimgV.width-36, 20)];
        _leftBottomLabel.textColor = [UIColor appWhiteLabelColor];
        _leftBottomLabel.font = [UIFont systemFontOfSize:14];
        _leftBottomLabel.text = @"个人活跃度";
    }
    return _leftBottomLabel;
}

- (UIImageView *)rightBgimgV {
    if (!_rightBgimgV) {
        _rightBgimgV = [[UIImageView alloc]initWithFrame:CGRectMake(12+(kScreenWidth-40)/2+16, kStatusBarHeight+20, (kScreenWidth-40)/2, 80)];
        _rightBgimgV.image = [UIImage imageNamed:@"xfb_top_zhyd_bg"];
    }
    return _rightBgimgV;
}

- (UILabel *)rightTopLabel {
    if (!_rightTopLabel) {
        _rightTopLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 14, self.rightBgimgV.width-36, 30)];
        _rightTopLabel.textColor = [UIColor appWhiteLabelColor];
        _rightTopLabel.font = [UIFont boldSystemFontOfSize:22];
    }
    return _rightTopLabel;
}

- (UILabel *)rightBottomLabel {
    if (!_rightBottomLabel) {
        _rightBottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 46, self.rightBgimgV.width-36, 20)];
        _rightBottomLabel.textColor = [UIColor appWhiteLabelColor];
        _rightBottomLabel.font = [UIFont systemFontOfSize:14];
        _rightBottomLabel.text = @"总活跃度";
    }
    return _rightBottomLabel;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
